! program main
!     implicit none
!     integer:: a,b,c,d
!     common a,b,c,d                     ! 声明为全局变量
!     a=1
!     b=2
!     call show()
!     write(*, *) a, b                   ! 30, 2
! end program main

! subroutine show()
!     implicit none                  
!     integer :: num1, num2, num3, num4
!     common num1, num2, num3, num4     ! 分别对应a,b,c,d
!     num1 = 30
!     return
! end

program main
    implicit none
    integer:: a,b,c,d
    common /group1/ a,b
    common /group2/ c,d                     ! 声明为全局变量
    c=1
    d=2
    call show()
    write(*, *) c, d                        ! 30, 25
end program main

subroutine show()
    implicit none                  
    integer :: num1, num2
    common /group2/ num1, num2              ! 分别对应c,d
    num1 = 30
    num2 = 25
    return
end

